package com.kirk.cts.ui.view.bar;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Component;

import javax.swing.*;
import java.util.List;

/**
 * <p> AppMenuBar.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-09-01 22:59
 * @Description 菜单栏对象
 */
@Component("appMenuBar")
public class AppMenuBar extends JMenuBar {
    private static final long serialVersionUID = 1L;

    public AppMenuBar() {
        super();
    }

    /**
     * 初始化菜单
     */
    public void initMenuBar() {

    }

    /**
     * 加载插件中的菜单项
     */
    public void loadPluginMenuBar(List<JMenu> menuList) {
        if (CollectionUtils.isNotEmpty(menuList)) {
            for (JMenu menu : menuList) {
                this.add(menu);
            }
        }
    }


}
